<template>
  <Modal title="网关属性" ok-text="确定" cancel-text="取消"
         :visible="visible" @cancel="close" @ok="handleOK">
    <RadioGroup :options="options" name="radioGroup" v-model="value"/>
  </Modal>
</template>
<script>
import {Modal, Radio} from 'ant-design-vue';
import {gatewayExecuteWayOptions} from '@/components/flow/typs/flow.js';

export default {
  name: 'GateWayConfiguration',
  components: {
    Modal,
    Radio,
    RadioGroup: Radio.Group,
  },
  props: {
    editingNode: {
      type: Object,
      default: () => ({executeWay: 'include'}),
    }
  },
  data() {
    return {
      value: undefined,
      options: gatewayExecuteWayOptions,
      visible: false
    };
  },
  methods: {
    handleOK() {
      this.editingNode.executeWay = this.value;
      this.$emit('ok', this.editingNode);
      this.close();
    },
    open() {
      this.visible = true;
      this.value = this.editingNode.executeWay;
    },
    close() {
      this.visible = false;
      this.$emit('close');
    },
  }
};
</script>